﻿using AutoUpdater.Entity;
using AutoUpdater.Util;
using PalletPrintProgram.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoUpdater.Bll
{
    public class FileCheckBll
    {
        public static string ServerUrl { get; set; }
        public static TscResponse<SysBasicInfo> CheckBaseSys(FileRequestVo fileCheckReq)
        {
            return RestHttpHelper.PostJson<SysBasicInfo>(SystemXmlUtil.GetServerUrl() + "/file/getSysByCode", fileCheckReq);
        }

        public static TscResponse<List<VscFileInfo>> GetAllNeedUpdateFile(FileRequestVo fileCheckReq)
        {
            return RestHttpHelper.PostJson<List<VscFileInfo>>(SystemXmlUtil.GetServerUrl() + "/file/selectFileTypeVsc", fileCheckReq);
        }

        public static byte[] DownLoadFile(FileRequestVo vo)
        {
            byte[] fileByte = RestHttpHelper.DownloadFile(SystemXmlUtil.GetServerUrl() + "/file/downloadFile", vo);
            return fileByte;
        }
    }
}
